package com.tedu.mappers;

import com.tedu.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Author：毕龙
 * Date: 2022/9/15 14:57
 */
public interface UserMapper {
    //查询所有用户信息
    List<User> findAll();

    String findUserByUP(User user);

    Long findCount();

    List<User> findUserLimit(@Param("query") String query,
                             @Param("start") int start,
                             @Param("pageSize") Integer pageSize);

    @Update("update user set status = #{status},updated =#{updated} where  id = #{id}")
    void updateStatus(User user);
    @Delete("delete from user where id = #{id}")
    void deleteUser(Integer id);
    @Insert("insert into user values(null,#{username},#{password},#{phone},#{email},#{status},#{created},#{updated}) ")
    void addUser(User user);
    @Select("select * from user where id= #{id}")
    User findUserById(Integer id);
    @Update("update user set phone=#{phone},email = #{email},updated=#{updated} where id= #{id}")
    void updateUser(User user);
}
